package org.bigdata.framework.core.protocol;

import java.util.HashMap;
import java.util.List;

import org.bigdata.framework.core.model.Classes;
import org.bigdata.framework.core.model.CommonDataProperty;
import org.bigdata.framework.core.model.CommonObjectProperty;
import org.bigdata.framework.core.model.CommunityCategory;
import org.bigdata.framework.core.model.DataBackup;
import org.bigdata.framework.core.model.DataExport;
import org.bigdata.framework.core.model.DataImport;
import org.bigdata.framework.core.model.DataInterface;
import org.bigdata.framework.core.model.DataProperty;
import org.bigdata.framework.core.model.DataRecovery;
import org.bigdata.framework.core.model.DataSource;
import org.bigdata.framework.core.model.DataSubmit;
import org.bigdata.framework.core.model.DataType;
import org.bigdata.framework.core.model.Department;
import org.bigdata.framework.core.model.Dict;
import org.bigdata.framework.core.model.DictItem;
import org.bigdata.framework.core.model.Feedback;
import org.bigdata.framework.core.model.IndexingRules;
import org.bigdata.framework.core.model.IndexingWeights;
import org.bigdata.framework.core.model.Log;
import org.bigdata.framework.core.model.Member;
import org.bigdata.framework.core.model.MemberMessage;
import org.bigdata.framework.core.model.Menu;
import org.bigdata.framework.core.model.MenuButton;
import org.bigdata.framework.core.model.NlpSensitiveWord;
import org.bigdata.framework.core.model.NlpStopWord;
import org.bigdata.framework.core.model.ObjectProperty;
import org.bigdata.framework.core.model.OpenLogin;
import org.bigdata.framework.core.model.Payment;
import org.bigdata.framework.core.model.Permission;
import org.bigdata.framework.core.model.PermissionButton;
import org.bigdata.framework.core.model.PermissionClasses;
import org.bigdata.framework.core.model.Project;
import org.bigdata.framework.core.model.RepositoryProduct;
import org.bigdata.framework.core.model.Role;
import org.bigdata.framework.core.model.SearchFavoriteCategory;
import org.bigdata.framework.core.model.SearchFavoriteResource;
import org.bigdata.framework.core.model.SearchHistory;
import org.bigdata.framework.core.model.SearchHotwords;
import org.bigdata.framework.core.model.SearchNotes;
import org.bigdata.framework.core.model.SearchSortRule;
import org.bigdata.framework.core.model.SearchSubscribe;
import org.bigdata.framework.core.model.SearchWeightCustoms;
import org.bigdata.framework.core.model.SearchWeightFields;
import org.bigdata.framework.core.model.ShardingDataSource;
import org.bigdata.framework.core.model.ShardingRepositoryCount;
import org.bigdata.framework.core.model.ShardingRepositoryDataSource;
import org.bigdata.framework.core.model.User;
import org.bigdata.framework.core.model.UserGroup;
import org.bigdata.framework.core.model.UserGroupRole;
import org.bigdata.framework.core.model.UserGroupUser;
import org.bigdata.framework.core.model.UserRole;
import org.bigdata.framework.core.model.Workflow;
import org.bigdata.framework.core.model.WorkflowExecute;
import org.bigdata.framework.core.model.WorkflowNode;

/**
 * 公开接口（读）
 * @author vimes
 *
 */
public interface IPublicService {
	
	/* 用户-机构-角色-权限管理模块 start */
	
	/* 用户管理 start */
	User findUser(Integer id);
	List<User> getUser();
	List<User> getUser(HashMap<String, Object> queryParams, int pageNumber, int pageSize);
	Integer getUserCount(HashMap<String, Object> queryParams);
	/* 用户管理 end */
	
	/* 部门管理 start */
	Department findDepartment(Integer id);
	List<Department> getDepartment();
	/* 部门管理 end */
	
	/* 领域-权限管理 start */
	PermissionClasses findPermissionClasses(Integer id);
	List<PermissionClasses> getPermissionClasses();
	List<PermissionClasses> getPermissionClasses(HashMap<String, Object> queryParams);
	/* 领域-权限管理 end */
	
	/* 菜单管理 start */
	Menu findMenu(Integer id);
	List<Menu> getMenu();
	/* 菜单管理 end */
	
	/* 菜单-按钮管理 start */
	MenuButton findMenuButton(Integer id);
	List<MenuButton> getMenuButton(HashMap<String, Object> queryParams);
	/* 菜单-按钮管理 end */
	
	/* 权限管理 start */
	Permission findPermission(Integer id);
	List<Permission> getPermission();
	List<Permission> getPermission(HashMap<String, Object> queryParams);
	/* 权限管理 end */
	
	/* 权限-按钮管理 start */
	PermissionButton findPermissionButton(Integer id);
	List<PermissionButton> getPermissionButton();
	List<PermissionButton> getPermissionButton(HashMap<String, Object> queryParams);
	/* 权限-按钮管理 end */
	
	/* 角色管理 start */
	Role findRole(Integer id);
	List<Role> getRole();
	List<Role> getRole(HashMap<String, Object> queryParams);
	/* 角色管理 end */
	
	/* 用户组管理 start */
	UserGroup findUserGroup(Integer id);
	List<UserGroup> getUserGroup();
	List<UserGroup> getUserGroup(HashMap<String, Object> queryParams);
	/* 用户组管理 end */
	
	/* 用户组管理 start */
	UserGroupRole findUserGroupRole(Integer id);
	List<UserGroupRole> getUserGroupRole();
	List<UserGroupRole> getUserGroupRole(HashMap<String, Object> queryParams);
	/* 用户组管理 end */
	
	/* 用户-角色管理 start */
	UserRole findUserRole(Integer id);
	List<UserRole> getUserRole();
	List<UserRole> getUserRole(HashMap<String, Object> queryParams);
	/* 用户-角色管理 end */
	
	/* 用户组-用户管理 start */
	UserGroupUser findUserGroupUser(Integer id);
	List<UserGroupUser> getUserGroupUser();
	List<UserGroupUser> getUserGroupUser(HashMap<String, Object> queryParams);
	/* 用户组-用户管理 end */
	
	/* 用户-机构-角色-权限管理模块 end */

	/* 数据类型管理 start */
	DataType findDataType(Integer id);
	List<DataType> getDataType();
	List<DataType> getDataType(HashMap<String, Object> queryParams, int pageNumber, int pageSize);
	Integer getDataTypeCount(HashMap<String, Object> queryParams);
	/* 数据类型管理 end */
	
	/* 字典类管理 start */
	Dict findDict(Integer id);
	List<Dict> getDict();
	List<Dict> getDict(HashMap<String, Object> queryParams, int pageNumber, int pageSize);
	Integer getDictCount(HashMap<String, Object> queryParams);
	/* 字典类管理 end */
	
	/* 字典项管理 start */
	DictItem findDictItem(Integer id);
	List<DictItem> getDictItem();
	List<DictItem> getDictItem(Dict dict);
	List<DictItem> getDictItem(HashMap<String, Object> queryParams, int pageNumber, int pageSize);
	Integer getDictItemCount(HashMap<String, Object> queryParams);
	/* 字典项管理 end */
	
	/* 公用数据属性管理 start */
	CommonDataProperty findCommonDataProperty(Integer id);
	List<CommonDataProperty> getCommonDataProperty();
	List<CommonDataProperty> getCommonDataProperty(HashMap<String, Object> queryParams, int pageNumber, int pageSize);
	Integer getCommonDataPropertyCount(HashMap<String, Object> queryParams);
	/* 公用数据属性管理 end */
	
	/* 公用对象属性管理 start */
	CommonObjectProperty findCommonObjectProperty(Integer id);
	List<CommonObjectProperty> getCommonObjectProperty();
	List<CommonObjectProperty> getCommonObjectProperty(HashMap<String, Object> queryParams, int pageNumber, int pageSize);
	Integer getCommonObjectPropertyCount(HashMap<String, Object> queryParams);
	/* 公用对象属性管理 end */ 
	
	/* 类管理 start */
	Classes findClasses(Integer id);
	List<Classes> getClasses();
	List<Classes> getClasses(HashMap<String, Object> queryParams, int pageNumber, int pageSize);
	Integer getClassesCount(HashMap<String, Object> queryParams);
	/* 类管理 end */
	
	/* 类-数据管理 start */
	DataProperty findDataProperty(Integer id);
	List<DataProperty> getDataProperty();
	List<DataProperty> getDataProperty(HashMap<String, Object> queryParams, int pageNumber, int pageSize);
	Integer getDataPropertyCount(HashMap<String, Object> queryParams);
	List<DataProperty> getDataProperty(Classes classes);
	/* 类-数据管理 end */
	
	/* 类-对象管理 start */
	ObjectProperty findObjectProperty(Integer id);
	List<ObjectProperty> getObjectProperty();
	List<ObjectProperty> getObjectProperty(Classes classes);
	List<ObjectProperty> getObjectPropertyByRelevance(Classes classes);
	/* 类-对象管理 end */
	
	/* 数据管理 start */
	
	/* 数据源管理 start */
	DataSource findDataSource(Integer id);
	List<DataSource> getDataSource();
	List<DataSource> getDataSource(HashMap<String, Object> queryParams, int pageNumber, int pageSize);
	Integer getDataSourceCount(HashMap<String, Object> queryParams);
	/* 数据源管理 end */
	
	/* 数据导入管理 start */
	DataImport findDataImport(Integer id);
	List<DataImport> getDataImport();
	List<DataImport> getDataImport(HashMap<String, Object> queryParams, int pageNumber, int pageSize);
	Integer getDataImportCount(HashMap<String, Object> queryParams);
	/* 数据导入管理 end */
	
	/* 数据导出管理 start */
	DataExport findDataExport(Integer id);
	List<DataExport> getDataExport();
	List<DataExport> getDataExport(HashMap<String, Object> queryParams, int pageNumber, int pageSize);
	Integer getDataExportCount(HashMap<String, Object> queryParams);
	/* 数据导出管理 end */
	
	/* 数据接口管理 start */
	DataInterface findDataInterface(Integer id);
	List<DataInterface> getDataInterface();
	List<DataInterface> getDataInterface(HashMap<String, Object> queryParams, int pageNumber, int pageSize);
	Integer getDataInterfaceCount(HashMap<String, Object> queryParams);
	/* 数据接口管理 end */
	
	/* 数据发布管理 start */
	DataSubmit findDataSubmit(Integer id);
	List<DataSubmit> getDataSubmit();
	List<DataSubmit> getDataSubmit(HashMap<String, Object> queryParams, int pageNumber, int pageSize);
	Integer getDataSubmitCount(HashMap<String, Object> queryParams);
	/* 数据发布管理 end */
	
	/* 数据集注册管理 start */
	Log findLog(Integer id);
	List<Log> getLog(HashMap<String, Object> queryParams, int pageNumber, int pageSize);
	Integer getLogCount(HashMap<String, Object> queryParams);
	/* 数据集注册管理 end */
	
	/* 数据管理 end */
	
	/** 知识应用管理功能区域 start **/
	
	/* 会员管理（包括个人用户、机构用户、机构下的个人） start */
	Member findMember(Integer id);
	List<Member> getMember();
	List<Member> getMember(HashMap<String, Object> queryParams, int pageNumber, int pageSize);
	Integer getMemberCount(HashMap<String, Object> queryParams);
	/* 会员管理（包括个人用户、机构用户、机构下的个人）  end */
	
	/* 第三方登录管理 start */
	OpenLogin findOpenLogin(Integer id);
	List<OpenLogin> getOpenLogin();
	/* 第三方登录管理 end */
	
	/* 支付方式管理 start */
	Payment findPayment(Integer id);
	List<Payment> getPayment();
	/* 支付方式管理 end */
	
	/* 产品管理 start */
	RepositoryProduct findRepositoryProduct(Integer id);
	List<RepositoryProduct> getRepositoryProduct();
	List<RepositoryProduct> getRepositoryProduct(HashMap<String, Object> queryParams, int pageNumber, int pageSize);
	Integer getRepositoryProductCount(HashMap<String, Object> queryParams);
	/* 产品管理 end */
	
	/** 知识应用管理功能区域 end **/
	
	/** 统一检索管理功能区域 start **/
	/* 热搜词 start */
	SearchHotwords findSearchHotwords(Integer id);
	List<SearchHotwords> getSearchHotwords();
	List<SearchHotwords> getSearchHotwords(HashMap<String, Object> queryParams, int pageNumber, int pageSize);
	Integer getSearchHotwordsCount(HashMap<String, Object> queryParams);
	/* 热搜词 end */
	
	/* 排序 start */
	SearchSortRule findSearchSortRule(Integer id);
	List<SearchSortRule> getSearchSortRule();
	List<SearchSortRule> getSearchSortRule(HashMap<String, Object> queryParams, int pageNumber, int pageSize);
	Integer getSearchSortRuleCount(HashMap<String, Object> queryParams);
	/* 排序 end */
	
	/* 自定义权重 start */
	SearchWeightCustoms findSearchWeightCustoms(Integer id);
	List<SearchWeightCustoms> getSearchWeightCustoms();
	List<SearchWeightCustoms> getSearchWeightCustoms(HashMap<String, Object> queryParams, int pageNumber, int pageSize);
	Integer getSearchWeightCustomsCount(HashMap<String, Object> queryParams);
	/* 自定义权重  end */
	
	/* 字段权重 start */
	SearchWeightFields findSearchWeightFields(Integer id);
	List<SearchWeightFields> getSearchWeightFields();
	List<SearchWeightFields> getSearchWeightFields(HashMap<String, Object> queryParams, int pageNumber, int pageSize);
	Integer getSearchWeightFieldsCount(HashMap<String, Object> queryParams);
	/* 字段权重 end */
	
	/** 统一检索管理功能区域 end **/
	
	/** 检索历史start **/
	SearchHistory findSearchHistory(Integer id);
	List<SearchHistory> getSearchHistory();
	List<SearchHistory> getSearchHistory(HashMap<String, Object> queryParams, int pageNumber, int pageSize);
	Integer getSearchHistoryCount(HashMap<String, Object> queryParams);
	/** 检索历史end **/
	/** pdf mark标记**/
	SearchNotes findSearchNotes(Integer id);
	List<SearchNotes>getSearchNotes();
	List<SearchNotes> getSearchNotes(HashMap<String, Object> queryParams, int pageNumber, int pageSize);
	Integer getSearchNotesCount(HashMap<String, Object> queryParams);
	
	/* api 权重配置 start */
	IndexingWeights findIndexingWeights(Integer id);
	List<IndexingWeights> getIndexingWeights();
	List<IndexingWeights> getIndexingWeights(HashMap<String, Object> queryParams, int pageNumber, int pageSize);
	Integer getIndexingWeightsCount(HashMap<String, Object> queryParams);
	/* api 权重配置 end */
	/* api 标引规则 start */
	IndexingRules findIndexingRules(Integer id);
	List<IndexingRules> getIndexingRules();
	List<IndexingRules> getIndexingRules(HashMap<String, Object> queryParams, int pageNumber, int pageSize);
	Integer getIndexingRulesCount(HashMap<String, Object> queryParams);
	/* api 标引规则 end */
	
	/* 敏感词字段 start */
	List<NlpSensitiveWord> getNlpSensitiveWord();
	NlpSensitiveWord findNlpSensitiveWord(Integer id);
	List<NlpSensitiveWord> getNlpSensitiveWord(HashMap<String, Object> queryParams, int pageNumber, int pageSize);
	Integer getNlpSensitiveWordCount(HashMap<String, Object> queryParams);
	/* 敏感词字段 end */
	
	/* 禁用词字段 start */
	List<NlpStopWord> getNlpStopWord();
	NlpStopWord findNlpStopWord(Integer id);
	List<NlpStopWord> getNlpStopWord(HashMap<String, Object> queryParams, int pageNumber, int pageSize);
	Integer getNlpStopWordCount(HashMap<String, Object> queryParams);
	/* 禁用词字段 end */
	
	/* 订阅管理 start */
	SearchSubscribe findSearchSubscribe(Integer id);
	List<SearchSubscribe> getSearchSubscribe();
	List<SearchSubscribe> getSearchSubscribe(HashMap<String, Object> queryParams, int pageNumber, int pageSize);
	Integer getSearchSubscribeCount(HashMap<String, Object> queryParams);
	/* 订阅管理 end */
	
	/* 知识库备份 start */
	DataBackup findDataBackup(Integer id);
	List<DataBackup> getDataBackup();
	List<DataBackup> getDataBackup(HashMap<String, Object> queryParams, int pageNumber, int pageSize);
	Integer getDataBackupCount(HashMap<String, Object> queryParams);
	/* 知识库备份 end */
	
	/* 知识库恢复 start */
	DataRecovery findDataRecovery(Integer id);
	List<DataRecovery> getDataRecovery();
	List<DataRecovery> getDataRecovery(HashMap<String, Object> queryParams, int pageNumber, int pageSize);
	Integer getDataRecoveryCount(HashMap<String, Object> queryParams);
	/* 知识库恢复 end */
	
	/* 分库分表-数据源管理 start */
	ShardingDataSource findShardingDataSource(Integer id);
	List<ShardingDataSource> getShardingDataSource();
	List<ShardingDataSource> getShardingDataSource(HashMap<String, Object> queryParams, int pageNumber, int pageSize);
	Integer getShardingDataSourceCount(HashMap<String, Object> queryParams);
	/* 分库分表-数据源管理 end */
	
	/* 分库分表-知识库-数据源管理 start */
	ShardingRepositoryDataSource findShardingRepositoryDataSource(Integer id);
	List<ShardingRepositoryDataSource> getShardingRepositoryDataSource();
	List<ShardingRepositoryDataSource> getShardingRepositoryDataSource(HashMap<String, Object> queryParams, int pageNumber, int pageSize);
	Integer getShardingRepositoryDataSourceCount(HashMap<String, Object> queryParams);
	/* 分库分表-知识库-数据源管理 end */
	
	/* 分库分表-知识库记录数 start */
	ShardingRepositoryCount findShardingRepositoryCount(Integer id);
	List<ShardingRepositoryCount> getShardingRepositoryCount();
	List<ShardingRepositoryCount> getShardingRepositoryCount(HashMap<String, Object> queryParams, int pageNumber, int pageSize);
	Integer getShardingRepositoryCountCount(HashMap<String, Object> queryParams);
	/* 分库分表-知识库记录数 end */
	
	/* 工作流 start */
	Workflow saveWorkflow(Workflow workflow);
	Workflow editWorkflow(Workflow workflow);
    void deleteWorkflow(Workflow workflow);
    Workflow findWorkflow(Integer id);
    List<Workflow> getWorkflow();
    List<Workflow> getWorkflow(HashMap<String, Object> queryParams, int pageNumber, int pageSize);
    Integer getWorkflowCount(HashMap<String, Object> queryParams);
    /*工作流 end */
    
    /* 工作流节点 start */
    WorkflowNode saveWorkflowNode(WorkflowNode workflowNode);
    WorkflowNode editWorkflowNode(WorkflowNode workflowNode);
    void deleteWorkflowNode(WorkflowNode workflowNode);
    WorkflowNode findWorkflowNode(Integer id);
    List<WorkflowNode> getWorkflowNode();
    List<WorkflowNode> getWorkflowNode(HashMap<String, Object> queryParams, int pageNumber, int pageSize);
    Integer getWorkflowNodeCount(HashMap<String, Object> queryParams);
    /*工作流节点  end */
    
    /* 工作流记录 start */
    WorkflowExecute saveWorkflowExecute(WorkflowExecute workflowExecute);
    WorkflowExecute editWorkflowExecute(WorkflowExecute workflowExecute);
    void deleteWorkflowExecute(WorkflowExecute workflowExecute);
    WorkflowExecute findWorkflowExecute(Integer id);
    List<WorkflowExecute> getWorkflowExecute();
    List<WorkflowExecute> getWorkflowExecute(HashMap<String, Object> queryParams, int pageNumber, int pageSize);
    Integer getWorkflowExecuteCount(HashMap<String, Object> queryParams);
    /*工作流记录 end */
    
    /* 站内消息表 start */
    MemberMessage findMemberMessage(Integer id);
	List<MemberMessage> getMemberMessage();
	List<MemberMessage> getMemberMessage(HashMap<String, Object> queryParams, int pageNumber, int pageSize);
	Integer getMemberMessageCount(HashMap<String, Object> queryParams);
    /* 站内消息表 end */
    
	/* 收藏分类表 start */
	SearchFavoriteCategory findSearchFavoriteCategory(Integer id);
	List<SearchFavoriteCategory> getSearchFavoriteCategory();
	List<SearchFavoriteCategory> getSearchFavoriteCategory(HashMap<String, Object> queryParams, int pageNumber, int pageSize);
	Integer getSearchFavoriteCategoryCount(HashMap<String, Object> queryParams);
	/* 收藏分类表 end */
	
	/* 收藏资源表  start */
	SearchFavoriteResource findSearchFavoriteResource(Integer id);
	List<SearchFavoriteResource> getSearchFavoriteResource();
	List<SearchFavoriteResource> getSearchFavoriteResource(HashMap<String, Object> queryParams, int pageNumber, int pageSize);
	Integer getSearchFavoriteResourceCount(HashMap<String, Object> queryParams);
	/* 收藏资源表  end */
	
	/* 意见反馈  start */
	Feedback findFeedback(Integer id);
	List<Feedback> getFeedback();
	List<Feedback> getFeedback(HashMap<String, Object> queryParams, int pageNumber, int pageSize);
	Integer getFeedbackCount(HashMap<String, Object> queryParams);
	/* 收藏资源表  end */
}
